package com.xy.demo.annotation.condition;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @ClassName: RiceCondition
 * @Description: TODO
 * @author: xy
 * @date: 2022/2/28  下午10:49
 */
public class RiceCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata annotatedTypeMetadata) {
        return context.getEnvironment().getProperty("people").equals("南方人");
    }
}
